package com.dnzx.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.dnzx.framework.page.PageResult;
import org.springframework.stereotype.Service;

import com.dnzx.dao.IPaymentTypeDao;
import com.dnzx.model.PaymentTypeBO;
import com.dnzx.service.IPaymentTypeService;

/**
 * 支付方式
 */
@Service
public class PaymentTypeServiceImpl implements IPaymentTypeService {

    @Resource
    private IPaymentTypeDao paymentTypeDao;
    
    @Override
    public void save(PaymentTypeBO paymentTypeBO) throws Exception {
    	this.paymentTypeDao.save(paymentTypeBO);
    }
    

    @Override
    public void delete(Long id) throws Exception {
        this.paymentTypeDao.delete(id);
    }

    @Override
    public void update(PaymentTypeBO paymentTypeBO) throws Exception {
        this.paymentTypeDao.update(paymentTypeBO);
    }

    @Override
    public PaymentTypeBO get(Long id) {
        return this.paymentTypeDao.get(id);
    }
    
    @Override
	public PaymentTypeBO get(PaymentTypeBO paymentTypeBO) {
		// TODO Auto-generated method stub
		return null;
	}

    @Override
    public List<PaymentTypeBO> queryList(PaymentTypeBO paymentTypeBO) {
        return this.paymentTypeDao.queryList(paymentTypeBO);
    }

    @Override
    public PageResult<List<PaymentTypeBO>> queryPage(PaymentTypeBO paymentTypeBO, PageResult<List<PaymentTypeBO>> pageResult) {
    	int totalRows = this.paymentTypeDao.queryCount(paymentTypeBO);
        pageResult.setTotalRows(totalRows);
        pageResult.setCurrentPage(paymentTypeBO.getCurrentPage());
        pageResult.setPageSize(paymentTypeBO.getPageSize());
		List<PaymentTypeBO> records = this.paymentTypeDao.queryPage(pageResult.getPageSize(), pageResult.getStartRow(), paymentTypeBO);
		pageResult.setT(records);
		return pageResult;
    }

}
